home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource5 / 363_01 / branch.asm < prev    next >
Assembly Source File  |  1991-12-17  |  3KB  |  57 lines

  1. * Branch instructions' tests.
  2.             bra     label1            8-bit branch sufficient
  3.             bra     label2            OK
  4.             bra     label3            32-bit branch
  5.             bra     label4            8-bit branch sufficient
  6.             bra     label5            OK
  7.             bra     label6            32-bit branch
  8.             bra.s   label1            OK
  9.             bra.s   label2            16-bit branch
  10.             bra.s   label3            32-bit branch
  11.             bra.s   label4            OK
  12.             bra.s   label5            16-bit branch
  13.             bra.s   label6            32-bit branch
  14.             bra.l   label1            8-bit branch
  15.             bra.l   label2            16-bit branch
  16.             bra.l   label3            OK
  17.             bra.l   label4            8-bit branch
  18.             bra.l   label5            16-bit branch
  19.             bra.l   label6                OK
  20. label1      equ     $10
  21. label2      equ     $1000
  22. label3      equ     $10000000
  23. label4      equ     -$10
  24. label5      equ     -$1000
  25. label6      equ     -$10000000
  26.             bra     label1            OK - assembler determines offset
  27.             bra     label2            OK - assembler determines offset
  28.             bra     label3            OK - assembler determines offset
  29.             bra     label4            OK - assembler determines offset
  30.             bra     label5            OK - assembler determines offset
  31.             bra     label6            OK - assembler determines offset
  32.             bra.s   label1            OK
  33.             bra.s   label2            16-bit branch
  34.             bra.s   label3            32-bit branch
  35.             bra.s   label4            OK
  36.             bra.s   label5            16-bit branch
  37.             bra.s   label6            32-bit branch
  38.             bra.l   label1            8-bit branch
  39.             bra.l   label2            16-bit branch
  40.             bra.l   label3            OK
  41.             bra.l   label4            8-bit branch
  42.             bra.l   label5            16-bit branch
  43.             bra.l   label6              OK
  44.             bra.s   label7              short branch to immediately following 
  45. *                                      instruction is not permitted
  46. label7      bra.s   label7-$7e        OK, just
  47. label8      bra.s   label8-$7f        too far
  48. label9      bra.s   label9+$81        OK, just
  49. label10     bra.s   label10+$82       too far
  50. label11     bra     label11-$7ffe     OK, assembler finds correct size
  51. label12     bra     label12-$7fff     OK, assembler finds correct size
  52. label13     bra     label13+$8001     OK, assembler finds correct size
  53. label14     bra     label14+$8002     OK, assembler finds correct size
  54.             bra.s   $74.l             valid size-syntax is accepted and ignored
  55.             bra.s   $74kV              superfluous characters in operand
  56.             end
  57.